package com.niit.musicserve.service.impl;

import com.niit.musicserve.dao.RankMapper;
import com.niit.musicserve.entity.Rank;
import com.niit.musicserve.service.RankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RankServiceImpl implements RankService {
	
	@Autowired
	public RankMapper rankMapper;
	
	@Override
	public Integer insertRank(Rank rank) {
		return rankMapper.insertRank(rank);
	}
	
	@Override
	public Integer deleteRankById(int rankId) {
		return rankMapper.deleteById(rankId);
	}
	
	@Override
	public Integer updateRankById(Rank rank) {
		return rankMapper.updateById(rank);
	}
	
	@Override
	public List<Rank> allRank() {
		return rankMapper.allRank();
	}
	
	@Override
	public Rank selectRankById(int rankId) {
		return rankMapper.selectByPrimary(rankId);
	}
	
	@Override
	public List<Rank> rankOfTitle(String rankTitle) {
		return rankMapper.rankOfTitle(rankTitle);
	}
	
	@Override
	public List<Rank> likeRankOfTitle(String rankTitle) {
		return rankMapper.likeRankOfTitle(rankTitle);
	}
	
	@Override
	public Integer numberOfRank() {return rankMapper.numberOfRank();
	}
}
